package ar.com.photo_admin.domain

class PhotographerPrices extends DomainObject {

	Photographer photographer
			
	List prices
	
	static belongsTo = [photographer : Photographer]
	
	static hasMany = [prices : PhotoPrice]
	
	Date validSince
	
	Date validUpto
	
    static constraints = {
		validSince(nullable:false)
		validUpto(nullable:true)
		photographer(nullable:false)
    }
	
	def findBySize(aSize){
		for(def price : prices){
			if(price.size == aSize)
				return price;
		}		
	}
}
